<template>
    <div class="wrapper">

        <v-head></v-head>

        <vSidebar :sideList ="sideList"></vSidebar>

<!--      上面基本是规定的-->

        <div class="content-box" :class="{'content-collapse':collapse}">
<!--            <v-tags></v-tags>-->

            <div class="content">
                <transition name="move" mode="out-in">
                    <keep-alive :include="tagsList">
                        <router-view :items="this.query"></router-view>
                    </keep-alive>
                </transition>
                <el-backtop target=".content"></el-backtop>
            </div>
        </div>
    </div>
</template>


<script>
import vHead from '../components/common/Header.vue';
import vSidebar from '../components/common/Sidebar.vue';
import vTags from '../components/common/Tags.vue';
import bus from '../components/common/bus';
import ClientInfo from '../components/common/ClientInfo'
import Global from '../utils/global'

export default {
    data() {
        return {
          query:null,
          client: {
            cName: ' ',
            cId: ' ',
            cTel: ' ',
            cPhoneNumber: ' ',
            cQNumber: ' ',
            cEmail: ' ',
            cUsername: ' ',
            cUnit: ' ',
          },
          tagsList: ["1",'2','2000-0505'],
          collapse: false,
          sideList://============sidelist//似乎不能动态的改变这个   呜呜呜
            [
              {
                icon:'el-icon-user-solid',
                index:'ClientInfo',//这里 应该是router-link
                title:'个人信息'
              },
              {
                icon:'el-icon-folder-opened',
                index:'Projects4Client',
                title:'我的项目'
              },
              {
                icon:'el-icon-chat-line-square',
                index:'Message',
                title:'我的消息'
              }
            ]
          //======================sidelist
        };
    },
    components: {
        vHead,
        vSidebar,
        vTags
    },
    created() {
        bus.$on('collapse-content', msg => {
            this.collapse = msg;
        });

        // 只有在标签页列表里的页面才使用keep-alive，即关闭标签之后就不保存到内存中了。
        bus.$on('tags', msg => {
            let arr = [];
            for (let i = 0, len = msg.length; i < len; i++) {
                msg[i].name && arr.push(msg[i].name);
            }
            this.tagsList = arr;
        });
      this.glo = new Global;
      this.query = this.glo.getData('ClientInfo');
      // this.query = sessionStorage.getItem('ClientInfo')


      // console.log(this.query+'------')
      this.$message('尊敬的客户:'+this.query.cName+", 欢迎使用本系统");

    },
  mounted () {

  }
};
</script>

<style>
  .content{
    margin: 0;
    padding: 0;
  }


</style>
